package servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author MissChen
 * @date 2024年04月24日 9:20
 */


public class LifeServlet extends HttpServlet {
    @Override
    public void init() throws ServletException {
        System.out.println("*********配置文件版初始方法***********");
        String name=getInitParameter("name");
        System.out.println("name:"+name);
        String age=getInitParameter("age");
        System.out.println("name:"+name+",age:"+age);
    }
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("执行核心业务逻辑");
    }
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("执行get请求");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("执行post请求");
    }



    @Override
    public void destroy() {
        System.out.println("正在销毁");
    }


}
